home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: MegaDisc / MegaDisc 27 (1992-03)(MegaDisc Digital Publishing)(AU)(Disk 2 of 2).zip / MegaDisc 27 (1992-03)(MegaDisc Digital Publishing)(AU)(Disk 2 of 2).adf / Programming / Basic_Routines / BasicSubs / Utilities / AboutChangePalette < prev    next >
Text File  |  1992-03-30  |  3KB  |  63 lines

  1.  
  2.  
  3.                               ABOUT CHANGEPALETTE    
  4.  
  5.  
  6.    (( 27 )) (( 27 )) (( 27 )) (( 27 )) (( 27 )) (( 27 )) (( 27 )) (( 27 ))
  7.  
  8.  
  9.  
  10.    I do most of my programming on a hi-res screen using 16 colours by choice
  11.    or 8 when I am forced into it by memory constraints. Because I am aiming
  12.    my programming at young children, I like a lot of strong, different
  13.    colours - and I don't particularly fancy the preset colours that come up
  14.    when you set up a screen with this number of colours. At first, I would
  15.    set up each program with its own set of palette statements, with the
  16.    values stored in a DATA statement. Very soon, however, I decided to write
  17.    a simple subroutine to load a set of colours from a text file into
  18.    memory. That subroutine, LOADCOLOURS, appears in the Subroutines drawer.
  19.    However, to maintain this text file, I needed to write a utility to
  20.    control the colours of my preset palette. So I wrote ChangePalette (CP).
  21.  
  22.    The main functions of CP are fairly obvious. On screen is shown the first
  23.    colour in the palette, its name and RGB values. You can scroll through
  24.    the 16 colours stored, modify the values or names of any of them and see
  25.    the result immediately in the display area. Any changes can be reset,
  26.    either individual colours or the whole set. Finally, there are save and
  27.    quit options.
  28.  
  29.    The only things about the program that are not self explanatory are:
  30.  
  31.    1. That the RGB fields expect a numeric value between 0 and 1 - all
  32.       other keys or values will be rejected. These values are consistent
  33.       with the form required by AmigaBASIC.
  34.    2. When entering data in either the name field or any of the RGB numeric
  35.       fields, hitting the <ESC> key will abort the colour modification.
  36.       Hitting the <RET> key at the first character will accept the preset
  37.       for that field.
  38.  
  39.    The program uses a number of subroutines presented in BasicUtils&Subs.
  40.    These include RAISED, GETINPUT and GETNUMBER, as well as a modified
  41.    version of LOADCOLOURS.
  42.  
  43.    It would be possible to modify the entry of RGB data using a slider
  44.    instead of numeric input fields. I have chosen the latter as I like to be
  45.    able to see the values I have put in rather than guess by the position of
  46.    the slider. This allows me to make exact modifications to give a
  47.    particular colour - the BASIC manual gives figures for 16 colours in its
  48.    explanation of the PALETTE command. It would also be possible to remove
  49.    the Modify key altogether and simply click on the field to be modified
  50.    (as in Ltd_Input.demo). However, my own personal preference is to work on
  51.    the full values of any one colour at a time.
  52.  
  53.    I generally put CP on all my program discs along with the text files that
  54.    it controls (Colours and Orig.Colours in the SetupFiles drawer) so that I
  55.    can modify the palette for any series of programs.
  56.  
  57.  
  58.  
  59.    (( 27 )) (( 27 )) (( 27 )) (( 27 )) (( 27 )) (( 27 )) (( 27 )) (( 27 ))
  60.  
  61.  
  62.  
  63.